package cn.labbook.bluetooth.entity;

import cn.labbook.bluetooth.util.DoubleUtils;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author lonzy
 * @since 2019-03-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TenantPay implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "tenant_pay_id", type = IdType.INPUT)
    private String tenantPayId;

    private String openId;

    private String ammeterId;

    /**
     * 充值金额
     */
    private Double payAmouont;
    /**
     * 充入电表金额
     */
    private Double payTrueAmouont;
    /**
     * 房东到手金额
     */
    private Double managerAmount;
    /**
     * 主站平台手续费
     */
    private Double zkisPlatformAmount;
    /**
     * 微信平台手续费
     */
    private Double wxPlatformAmount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payTime;

    /**
     * 充值是否成功（0：成功 1：不成功）
     */
    private Integer payStatus;
    /**
     * 房东收款是否成功（0：成功 1：不成功）
     */
    private Integer isArrive;

    /**
     * 同步是否成功（0：失败 1：成功）
     */
    private Integer isSynchrony;

    /**
     * 备注
     */
    private String remark;

    /**
     * 转账失败原因
     */
    private String failReason;

    /**
     * 房东转账时间
     */
    private String managerTransferTime;
    /**
     * 房东转账订单号
     */
    private String managerTransferOrderNo;


    private transient String location;

    public Double getPayTrueAmouont() {
        return DoubleUtils.getZeroIfNull(payTrueAmouont);
    }

    public Double getManagerAmount() {
        return DoubleUtils.getZeroIfNull(managerAmount);
    }

}
